/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pojo;

import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author pvhuy
 */
@Entity
@Table(name=NhomSanPham.TABLE_NHOMSANPHAM)
public class NhomSanPham extends Base{
    public static final String TABLE_NHOMSANPHAM = "NhomSanPham";

    protected static final String COLUMN_TENNHOMSANPHAM = "TenNhomSanPham";
    private static final int LENGTH_TENNHOMSANPHAM = 45;
    @Column(name=COLUMN_TENNHOMSANPHAM, length=LENGTH_TENNHOMSANPHAM, nullable=false)
    private String tenNhomSanPham;

    @OneToMany(mappedBy="nhomSanPham", cascade=CascadeType.ALL)
    private List<TheLoai> danhSachTheLoai;

    /**
     * @return the tenNhomSanPham
     */
    public String getTenNhomSanPham() {
        return tenNhomSanPham;
    }

    /**
     * @param tenNhomSanPham the tenNhomSanPham to set
     */
    public void setTenNhomSanPham(String tenNhomSanPham) {
        this.tenNhomSanPham = tenNhomSanPham;
    }

    /**
     * @return the danhSachTheLoai
     */
    public List<TheLoai> getDanhSachTheLoai() {
        return danhSachTheLoai;
    }

    /**
     * @param danhSachTheLoai the danhSachTheLoai to set
     */
    public void setDanhSachTheLoai(List<TheLoai> danhSachTheLoai) {
        this.danhSachTheLoai = danhSachTheLoai;
    }
}
